package jdbc3_25.homework;

import java.sql.Connection;
import java.sql.Statement;

public class JDBCDemo02 {
    public static void main(String[] args) {
try (Connection connection = DBUtil01.getConnection()) {
    Statement statement = connection.createStatement();
    String sql = "INSERT INTO user1(username,password,nickname,age) " +
            "VALUES('张三','123456','阿三',22)";

    int num = statement.executeUpdate(sql);
    if (num > 0){
        System.out.println("插入成功");
    }
} catch (Exception e) {
            e.printStackTrace();
    }
}
}